<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${ctx}/component/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<%@ include file="/include/header.jsp"%>
</head>
<body>
	<div class="wrap">

		<div class="main_panel">
			<div class="ch_panel" id="queryDiv">
				<input type="hidden" data-qname="currentPage" value="1" />
				<table class="c_table">
					<tr>
						<td class="t_tit t_r">操作人 :</td>
						<td class="t_l">
							<input type="text" data-qname="operationUsername" value="" class="input_txt" style="width: 125px;" />
						</td>
						<td class="t_tit t_r">操作动作 :</td>
						<td class="t_l">
							<select data-qname="operationAction" style="width: 100px;">
								<option value="">==请选择==</option>
								<c:forEach items="${operActionMap}" var="var">
									<option value="${var.key }">${var.value}</option>
								</c:forEach>
							</select>
						</td>
						<td class="t_tit t_r">操作时间:</td>
						<td class="t_l">
							<input type="text" data-qname="beginOperationTime" class="input_txt" readonly="readonly" onfocus="WdatePicker({isShowWeek:true})" style="width: 120px" />
							~
							<input type="text" data-qname="endOperationTime" class="input_txt" readonly="readonly" onfocus="WdatePicker({isShowWeek:true})" class="input_txt" style="width: 120px" />
						</td>
						<td class="t_tit t_r">IP地址:</td>
						<td class="t_l">
							<input type="text" data-qname="ip" value="" class="input_txt" style="width: 150px;" />
						</td>
						<td class="t_l">
							<input type="button" value="查询" id="searchBtn" class="c_btn" />
						</td>
					</tr>
				</table>
			</div>

			<!-- tab -->
			<!-- 列表 -->
			<div id="pro_2" class="pro_box ">
				<table id="tbwrap" class="table table-border table-bordered table-bg m_t10 hovaertable"></table>
				<div class="page eui-pager-custom" id="j_pager"></div>
			</div>
		</div>
	</div>

	<script type="text/html" id="tb_template">
	    <thead>
			<tr>
				<th width="111">操作人</th>
				<th>操作内容</th>
				<th width="150">IP地址</th>
				<th width="160">操作时间</th>
				<th width="90">动作类型</th>
			<%--	<th width="50">操作</th> --%>
			</tr>
		</thead>
		<tbody data-type="body" id="queryTable">
    		<!if(list.length>0) { !>
        		<!for(var i=0,len=list.length;i<len;i++){
            		var item = list[i],classItem = (i%2!=0)?"odd td_odd":"even";
          		!>
		    	<tr class="gradeA <!=classItem!>">
			    	<td><!=item["operationUsername"]!></td>
					<td title="<!=item["opeContent"]!>"><!=item["opeContent"]!></td>
			    	<td><!=item["ip"]!></td>
			    	<td><!=item["operationTime"]!></td>
  					<td><!=item["operationActionName"]!></td>
			    	<%--	<td>
						<a title="详情" data-value="<!=item["logId"]!>" class="a_detail"></a>
					</td> --%>
		   		</tr>
        	<!}!>
    		<!}else{!>
				<tr>
		    		<td colspan="10"> 暂无数据</td>
				</tr>
    		<!}!>
 		</tbody>
	</script>


	<script type="text/javascript">
	var sysLogDialog;
	$(function(){
		// 2、详细
		$("#tbwrap").delegate(".a_detail", "click", function () {
			// 2.1 获取主键
			var logId = $(this).data("value");
			// 2.2 弹窗窗口，显示详细信息
			seajs.use("component/dialog", function (dialog) {
			    sysLogDialog = new dialog({
			        "width" : 800,
			        "height" : 360,
			        "contentType" : "iframe",
					"html" : "${ctx}/sysNodeLog/view?logId="+logId, // 内容
			        "title" : "查看系统操作日志信息", //标题
			        "contentScroll":false
				});
			});
		});
		// 5、查询
		$("#searchBtn").click(function () {
			search();
        });
	});
	</script>

	<script type="text/javascript">
		$(function () {
	        search();
	    });
		
		function search() {
			// 这里放包含查询条件的DIV
			var paramData = easyUtils.getQueryDivDefault("queryDiv");
			
			seajs.use([ "component/table" ], function(uiTable) {
				var param = {
					url : "${ctx}/sysNodeLog/ajaxPage",
					data : paramData
				};
				easyUtils.getData(param, function(result) {
					easyUtils.buildTable(result, param, uiTable);
					if(result.dataList.length>0){	
						easyUtils.fullRows("queryTable",5);
					}
				});
			});
		}
	</script>

</body>
</html>
